/*
 * Copyright (C) 2011 by Fabien Barbero
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.flickr.api.photos.people;

import com.flickr.api.FlickrServiceException;
import com.flickr.api.people.User;
import com.flickr.api.photos.Person;
import com.flickr.api.photos.Photo;
import java.awt.Rectangle;
import java.util.List;

/**
 *
 * @author Fabien Barbero
 */
public interface PhotosPeopleService {
    
    /**
     * Add a person to a photo.
     * Coordinates and sizes of boxes are optional; they are measured in pixels,
     * based on the 500px image size shown on individual photo pages.
     * @param photo                     The photo.
     * @param user                      The user to add.
     * @param rect                      The position of the the user on the photo (can be null).
     * @throws FlickrServiceException   Error adding user to photo.
     */
    void addUserToPhoto(Photo photo, User user, Rectangle rect) throws FlickrServiceException;
    
    /**
     * Remove a person from a photo.
     * @param photo                     The photo.
     * @param user                      The user to remove.
     * @throws FlickrServiceException   Error removing user.
     */
    void removeUserFromPhoto(Photo photo, User user) throws FlickrServiceException;
    
    /**
     * Remove the bounding box from a person in a photo.
     * @param photo                     The photo.
     * @param user                      The user.
     * @throws FlickrServiceException   Error removing user coordinates.
     */
    void removeUserCoordinates(Photo photo, User user) throws FlickrServiceException;
    
    /**
     * Edit the bounding box of an existing person on a photo.
     * @param photo                     The photo.
     * @param user                      The user to add.
     * @param rect                      The position of the the user on the photo.
     * @throws FlickrServiceException   Error editing coordinates.
     */
    void editUserCoordinates(Photo photo, User user, Rectangle rect) throws FlickrServiceException;
    
    /**
     * Get a list of people in a given photo.
     * @param photo                     The photo.
     * @return                          The list of persons.
     * @throws FlickrServiceException   Error getting the list of persons.
     */
    List<TaggedUser> getPersonsOnPhoto(Photo photo) throws FlickrServiceException;
    
}
